package com.sleep.model;

import javax.persistence.*;

/**
 * Created by fadinglan on 2017/4/10.
 */
@Entity
@Table(name = "user_device_info", schema = "teenagers_monitor", catalog = "")
public class UserDeviceInfoEntity {
    private int iUserDeviceId;
    private String vcDeviceId;
    private String iUserId;

    @Id
    @Column(name = "i_user_device_id", nullable = false)
    public int getiUserDeviceId() {
        return iUserDeviceId;
    }

    public void setiUserDeviceId(int iUserDeviceId) {
        this.iUserDeviceId = iUserDeviceId;
    }

    @Basic
    @Column(name = "vc_device_id", nullable = false, length = 20)
    public String getVcDeviceId() {
        return vcDeviceId;
    }

    public void setVcDeviceId(String vcDeviceId) {
        this.vcDeviceId = vcDeviceId;
    }

    @Basic
    @Column(name = "i_user_id", nullable = false, length = 20)
    public String getiUserId() {
        return iUserId;
    }

    public void setiUserId(String iUserId) {
        this.iUserId = iUserId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        UserDeviceInfoEntity that = (UserDeviceInfoEntity) o;

        if (iUserDeviceId != that.iUserDeviceId) return false;
        if (vcDeviceId != null ? !vcDeviceId.equals(that.vcDeviceId) : that.vcDeviceId != null) return false;
        if (iUserId != null ? !iUserId.equals(that.iUserId) : that.iUserId != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = iUserDeviceId;
        result = 31 * result + (vcDeviceId != null ? vcDeviceId.hashCode() : 0);
        result = 31 * result + (iUserId != null ? iUserId.hashCode() : 0);
        return result;
    }
}
